package org.ii.infrastructure.web;

public class UrlUtil {

	/**
	 * Strips the requestUri, by removing any portal information in the beginning of the URI.
	 */
	public static String getStrippedUrl(String requestUri) {
		final String[] paths = requestUri.split("/");
		try {
			@SuppressWarnings("unused")
			final Integer portalId = new Integer(paths[0]);
		} catch (final NumberFormatException e) {
			// Not a number, do not extract ID
			return requestUri;
		}
		requestUri = requestUri.substring(requestUri.indexOf("/") + 1);
		return requestUri;
	}
}

